@import './variables.less';
@import '../../style/mixins.less';

.fnx-picker {
	position: relative;
	background-color: var(--fnx-picker-background-color);
	user-select: none;

	&__toolbar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: var(--fnx-picker-toolbar-height);
	}

	&__cancel,
	&__confirm {
		height: 100%;
		padding: var(--fnx-picker-action-padding);
		font-size: var(--fnx-picker-action-font-size);
		background-color: transparent;
		border: none;
		cursor: pointer;

		&:active {
			opacity: var(--fnx-active-opacity);
		}
	}

	&__confirm {
		color: var(--fnx-picker-confirm-action-color);
	}

	&__cancel {
		color: var(--fnx-picker-cancel-action-color);
	}

	&__title {
		max-width: 50%;
		font-weight: var(--fnx-font-weight-bold);
		font-size: var(--fnx-picker-title-font-size);
		line-height: var(--fnx-picker-title-line-height);
		text-align: center;
	}

	&__columns {
		position: relative;
		display: flex;
		cursor: grab;
	}

	&__loading {
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 3;
		display: flex;
		align-items: center;
		justify-content: center;
		color: var(--fnx-picker-loading-icon-color);
		background-color: var(--fnx-picker-loading-mask-color);
	}

	&__frame {
		position: absolute;
		top: 50%;
		right: var(--fnx-padding-md);
		left: var(--fnx-padding-md);
		z-index: 2;
		transform: translateY(-50%);
		pointer-events: none;
	}

	&__mask {
		position: absolute;
		top: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 100%;
		background-image: linear-gradient(
				180deg,
				hsla(0, 0%, 100%, 0.9),
				hsla(0, 0%, 100%, 0.4)
			),
			linear-gradient(
				0deg,
				hsla(0, 0%, 100%, 0.9),
				hsla(0, 0%, 100%, 0.4)
			);
		background-repeat: no-repeat;
		background-position: top, bottom;
		// fix rendering failure during animation on safari
		transform: translateZ(0);
		pointer-events: none;
	}
}

.fnx-picker-column {
	flex: 1;
	overflow: hidden;
	font-size: var(--fnx-picker-option-font-size);

	&__wrapper {
		transition-timing-function: cubic-bezier(0.23, 1, 0.68, 1);
	}

	&__option {
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0 var(--fnx-padding-base);
		color: var(--fnx-picker-option-text-color);
	}
}
